From e78956d1a62bfe01f0f01a10f4c50055c180297c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 19 May 2016 03:51:07 +0300 Subject: [PATCH] more auto refactoring fixes --- tests/test_cargo_compile_custom_build.rs | 53 +++++++++++++----------- tests/test_cargo_compile_git_deps.rs | 10 ++--- tests/test_cargo_compile_path_deps.rs | 8 ++-- tests/test_cargo_cross_compile.rs | 16 +++---- tests/test_cargo_test.rs | 12 +++--- 5 files changed, 52 insertions(+), 47 deletions(-) diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index c74446f63..d78a23a29 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -471,19 +471,19 @@ test!(testing_and_such { println!("test"); assert_that(p.cargo("test").arg("-vj1"), execs().with_status(0) - .with_stdout("\ + .with_stderr("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc [..] --crate-name foo [..]` [RUNNING] `rustc [..] --crate-name foo [..]` [RUNNING] `[..]foo-[..][..]` - +[DOCTEST] foo +[RUNNING] `rustdoc --test [..]`") + .with_stdout(" running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -[DOCTEST] foo -[RUNNING] `rustdoc --test [..]` running 0 tests @@ -730,7 +730,7 @@ test!(build_cmd_with_a_build_cmd { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0) - .with_stdout("\ + .with_stderr("\ [COMPILING] b v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name b [..]` [COMPILING] a v0.5.0 (file://[..]) @@ -888,9 +888,10 @@ test!(code_generation { "#); assert_that(p.cargo_process("run"), execs().with_status(0) - .with_stdout("\ + .with_stderr("\ [COMPILING] foo v0.5.0 (file://[..]) -[RUNNING] `target[..]foo` +[RUNNING] `target[..]foo`") + .with_stdout("\ Hello, World! ")); @@ -1310,7 +1311,7 @@ test!(cfg_test { fn test_bar() {} "#); assert_that(p.cargo_process("test").arg("-v"), - execs().with_stdout(format!("\ + execs().with_stderr(format!("\ [COMPILING] foo v0.0.1 ({dir}) [RUNNING] [..] build.rs [..] [RUNNING] [..]build-script-build[..] @@ -1318,28 +1319,28 @@ test!(cfg_test { [RUNNING] [..] --cfg foo[..] [RUNNING] [..] --cfg foo[..] [RUNNING] [..]foo-[..] - +[RUNNING] [..]test-[..] +[DOCTEST] foo +[RUNNING] [..] --cfg foo[..]", dir = p.url())) + .with_stdout(" running 1 test test test_foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -[RUNNING] [..]test-[..] running 1 test test test_bar ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -[DOCTEST] foo -[RUNNING] [..] --cfg foo[..] running 1 test test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", dir = p.url()))); +")); }); test!(cfg_doc { @@ -1426,34 +1427,34 @@ test!(cfg_override_test { fn test_bar() {} "#); assert_that(p.cargo_process("test").arg("-v"), - execs().with_stdout(format!("\ + execs().with_stderr(format!("\ [COMPILING] foo v0.0.1 ({dir}) [RUNNING] `[..]` [RUNNING] `[..]` [RUNNING] `[..]` [RUNNING] [..]foo-[..] - +[RUNNING] [..]test-[..] +[DOCTEST] foo +[RUNNING] [..] --cfg foo[..]", dir = p.url())) + .with_stdout(" running 1 test test test_foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -[RUNNING] [..]test-[..] running 1 test test test_bar ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -[DOCTEST] foo -[RUNNING] [..] --cfg foo[..] running 1 test test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", dir = p.url()))); +")); }); test!(cfg_override_doc { @@ -1537,7 +1538,8 @@ test!(flags_go_into_tests { "#); assert_that(p.cargo_process("test").arg("-v").arg("--test=foo"), - execs().with_status(0).with_stdout("\ + execs().with_status(0) + .with_stderr("\ [COMPILING] a v0.5.0 ([..] [RUNNING] `rustc a[..]build.rs [..]` [RUNNING] `[..]build-script-build[..]` @@ -1547,8 +1549,8 @@ test!(flags_go_into_tests { [COMPILING] foo v0.5.0 ([..] [RUNNING] `rustc src[..]lib.rs [..] -L test[..]` [RUNNING] `rustc tests[..]foo.rs [..] -L test[..]` -[RUNNING] `[..]foo-[..]` - +[RUNNING] `[..]foo-[..]`") + .with_stdout(" running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured @@ -1556,12 +1558,13 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ")); assert_that(p.cargo("test").arg("-v").arg("-pb").arg("--lib"), - execs().with_status(0).with_stdout("\ + execs().with_status(0) + .with_stderr("\ [FRESH] a v0.5.0 ([..] [COMPILING] b v0.5.0 ([..] [RUNNING] `rustc b[..]src[..]lib.rs [..] -L test[..]` -[RUNNING] `[..]b-[..]` - +[RUNNING] `[..]b-[..]`") + .with_stdout(" running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index cff25cb82..f1ed636cf 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -615,7 +615,7 @@ test!(update_with_shared_deps { // First time around we should compile both foo and bar assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("\ + execs().with_stderr(&format!("\ [UPDATING] git repository `{git}` [COMPILING] bar v0.5.0 ({git}#[..]) [COMPILING] [..] v0.5.0 ([..]) @@ -670,7 +670,7 @@ To learn more, run the command again with --verbose. // Make sure we still only compile one version of the git repo println!("build"); assert_that(p.cargo("build"), - execs().with_stdout(&format!("\ + execs().with_stderr(&format!("\ [COMPILING] bar v0.5.0 ({git}#[..]) [COMPILING] [..] v0.5.0 ({dir}[..]dep[..]) [COMPILING] [..] v0.5.0 ({dir}[..]dep[..]) @@ -998,11 +998,11 @@ test!(dev_deps_with_testing { // Make sure we use the previous resolution of `bar` instead of updating it // a second time. assert_that(p.cargo("test"), - execs().with_stdout("\ + execs().with_stderr("\ [COMPILING] [..] v0.5.0 ([..]) [COMPILING] [..] v0.5.0 ([..] -[RUNNING] target[..]foo-[..] - +[RUNNING] target[..]foo-[..]") + .with_stdout(" running 1 test test tests::foo ... ok diff --git a/tests/test_cargo_compile_path_deps.rs b/tests/test_cargo_compile_path_deps.rs index 535823874..4eb560feb 100644 --- a/tests/test_cargo_compile_path_deps.rs +++ b/tests/test_cargo_compile_path_deps.rs @@ -741,16 +741,16 @@ test!(dev_deps_no_rebuild_lib { assert_that(p.cargo("test"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stderr(&format!("\ [COMPILING] [..] v0.5.0 ({url}[..]) [COMPILING] [..] v0.5.0 ({url}[..]) -[RUNNING] target[..]foo-[..] - +[RUNNING] target[..]foo-[..]", url = p.url())) + .with_stdout(" running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", url = p.url()))); +")); }); test!(custom_target_no_rebuild { diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index 2867619b1..2138bc84e 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -460,23 +460,23 @@ test!(cross_tests { let target = alternate(); assert_that(p.cargo_process("test").arg("--target").arg(&target), execs().with_status(0) - .with_stdout(&format!("\ + .with_stderr(&format!("\ [COMPILING] foo v0.0.0 ({foo}) [RUNNING] target[..]{triple}[..]bar-[..] - +[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target)) + .with_stdout(" running 1 test test test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -[RUNNING] target[..]{triple}[..]foo-[..] running 1 test test test_foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", foo = p.url(), triple = target))); +")); }); test!(no_cross_doctests { @@ -525,15 +525,15 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured let target = alternate(); assert_that(p.cargo_process("test").arg("--target").arg(&target), execs().with_status(0) - .with_stdout(&format!("\ + .with_stderr(&format!("\ [COMPILING] foo v0.0.0 ({foo}) -[RUNNING] target[..]{triple}[..]foo-[..] - +[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target)) + .with_stdout(" running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", foo = p.url(), triple = target))); +")); }); test!(simple_cargo_run { diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index 81ac9d3f5..7d0493e3b 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -186,7 +186,8 @@ test!(cargo_test_failing_test { assert_that(p.cargo("test"), execs().with_stderr(format!("\ [COMPILING] foo v0.5.0 ({url}) -[RUNNING] target[..]foo-[..]", url = p.url())) +[RUNNING] target[..]foo-[..] +[ERROR] test failed", url = p.url())) .with_stdout_contains(" running 1 test test test_hello ... FAILED @@ -2058,15 +2059,16 @@ test!(only_test_docs { p.build(); assert_that(p.cargo("test").arg("--doc"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0) + .with_stderr(&format!("\ [COMPILING] foo v0.0.1 ([..]) -[DOCTEST] foo - +[DOCTEST] foo")) + .with_stdout(" running 1 test test bar_0 ... ok test result: ok.[..] -"))); +")); }); -- 2.30.2